package com.xjl.aop.springbootaop.service;

import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.stereotype.Service;

@EnableAsync
@Service
public class AopService {

    public void testMethod(){
        for(int i=0;i<10;i++){
            System.out.println("+++++++++++++++++++++++");
        }

    }


    @Async
    public void ansyMethod(){
        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        for(int i=0;i<10;i++){
            System.out.println("-------------------------------");
        }
    }
}
